#pragma once

#include <boost/shared_ptr.hpp>

#include "exports.hpp"
#include "TableDL.hpp"




namespace db
{
	class DB_SCHEMA_API RDBMS
	{
	public:

		typedef boost::shared_ptr<RDBMS>         Ptr;
		typedef boost::shared_ptr<const RDBMS>   const_Ptr;

		enum Type
		{
			SQLITE
		};

	public:

		RDBMS();
		virtual ~RDBMS();

		/**
		 * @returns an RDBMS for the given type
		 */
		static RDBMS::Ptr create(Type type);



		/**
		 * @returns an sql statement to create the given table
		 */
		virtual QString createTableString(TableDL::const_Ptr table) const;

		/**
		 * @returns an sql statement to drop the given table
		 */
		virtual QString dropTableString(TableDL::const_Ptr table) const;

		/**
		 * @returns an sql statement to create the given attribute
		 */
		virtual QString createAttributeString(Attribute::const_Ptr attribute) const;

		/**
		 * @returns string representing the data type of the given attribute
		 */
		virtual QString dataTypeString(TableAttribute::const_Ptr attribute) const = 0;

		/**
		 * @returns sql statement to add the given attribute to the given table
		 */
		virtual QString addAttributeString(Table::const_Ptr table, TableAttribute::const_Ptr attribute) const = 0;

		/**
		 * @returns sql statement to drop the given attribute from the given table.
		 */
		virtual QString dropAttributeString(Table::const_Ptr table, TableAttribute::const_Ptr attribute) const = 0;
	};
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
